package View;

import View.Cadastros.ListaProduto;
import View.Cadastros.ListaUsuario;
import View.Venda.ConsultaVendas;
import View.Venda.Venda;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 *
 * @author Contagem
 */
public class Inicio extends javax.swing.JFrame {

    /** Creates new form Inicio */
    public Inicio() {

        initComponents();

        JLabel label2 = new JLabel(new ImageIcon("./img/bt_usuarios.png"));
        btnCadastroUsuario.add(label2);
        btnCadastroUsuario.setContentAreaFilled(false);
        btnCadastroUsuario.setBorderPainted(false);
        btnCadastroUsuario.setToolTipText("Cadastro de usuários");
      
        
        JLabel label3 = new JLabel(new ImageIcon("./img/bt_produtos.png"));
        btnCadastroProduto.add(label3);
        btnCadastroProduto.setContentAreaFilled(false);
        btnCadastroProduto.setBorderPainted(false);
        btnCadastroProduto.setToolTipText("Cadastro de produtos");
        
        JLabel label3b = new JLabel(new ImageIcon("./img/bt_caixa.png"));
        btnCaixa.add(label3b);
        btnCaixa.setContentAreaFilled(false);
        btnCaixa.setBorderPainted(false);
        btnCaixa.setToolTipText("iniciar o CAIXA");
        
        JLabel label3c = new JLabel(new ImageIcon("./img/bt_consultaVendas.png"));
        btn_consultaVendas.add(label3c);
        btn_consultaVendas.setContentAreaFilled(false);
        btn_consultaVendas.setBorderPainted(false);
        btn_consultaVendas.setToolTipText("Consultar Vendas");


      //  this.setResizable(false);
        this.setLocationRelativeTo(null);
   }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jDesktopPane1 = new javax.swing.JDesktopPane();
        jDesktopPane2 = new javax.swing.JDesktopPane();
        btnCadastroUsuario = new javax.swing.JButton();
        btnCadastroProduto = new javax.swing.JButton();
        jDesktopPane3 = new javax.swing.JDesktopPane();
        btnCaixa = new javax.swing.JButton();
        btn_consultaVendas = new javax.swing.JButton();
        btn_SAIR = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(204, 204, 255));
        jPanel1.setOpaque(false);
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jTabbedPane1.setBackground(new java.awt.Color(51, 255, 153));
        jTabbedPane1.setToolTipText("");
        jTabbedPane1.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N

        jDesktopPane1.setForeground(new java.awt.Color(204, 204, 255));
        jDesktopPane1.setDesktopManager(null);
        jDesktopPane1.setOpaque(false);
        jTabbedPane1.addTab("Sistema", jDesktopPane1);

        jDesktopPane2.setOpaque(false);

        btnCadastroUsuario.setPreferredSize(new java.awt.Dimension(200, 150));
        btnCadastroUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastroUsuarioActionPerformed(evt);
            }
        });
        btnCadastroUsuario.setBounds(60, 100, 220, 150);
        jDesktopPane2.add(btnCadastroUsuario, javax.swing.JLayeredPane.DEFAULT_LAYER);

        btnCadastroProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastroProdutoActionPerformed(evt);
            }
        });
        btnCadastroProduto.setBounds(300, 100, 220, 150);
        jDesktopPane2.add(btnCadastroProduto, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTabbedPane1.addTab("Cadastros", jDesktopPane2);

        jDesktopPane3.setOpaque(false);

        btnCaixa.setText("Caixa");
        btnCaixa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCaixaActionPerformed(evt);
            }
        });
        btnCaixa.setBounds(60, 100, 220, 150);
        jDesktopPane3.add(btnCaixa, javax.swing.JLayeredPane.DEFAULT_LAYER);

        btn_consultaVendas.setText("Consulta Vendas");
        btn_consultaVendas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_consultaVendasActionPerformed(evt);
            }
        });
        btn_consultaVendas.setBounds(300, 100, 220, 150);
        jDesktopPane3.add(btn_consultaVendas, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTabbedPane1.addTab("Venda", jDesktopPane3);

        jPanel1.add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 40, 586, 454));

        btn_SAIR.setText("SAIR");
        btn_SAIR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_SAIRActionPerformed(evt);
            }
        });
        jPanel1.add(btn_SAIR, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 10, 80, -1));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 495, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btnCadastroUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastroUsuarioActionPerformed
    ListaUsuario listaUsuario = new ListaUsuario(this, true);
    listaUsuario.setVisible(true);
}//GEN-LAST:event_btnCadastroUsuarioActionPerformed

private void btnCadastroProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastroProdutoActionPerformed

    ListaProduto listaProduto = new ListaProduto(this, true);
    listaProduto.setVisible(true);

}//GEN-LAST:event_btnCadastroProdutoActionPerformed

private void btnCaixaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCaixaActionPerformed
    Venda venda = new Venda(this, true);
    venda.show();

}//GEN-LAST:event_btnCaixaActionPerformed

private void btn_consultaVendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_consultaVendasActionPerformed
    ConsultaVendas consultaVendas = new ConsultaVendas(this, true);
    consultaVendas.show(true);
}//GEN-LAST:event_btn_consultaVendasActionPerformed

private void btn_SAIRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_SAIRActionPerformed
    System.exit(0);
}//GEN-LAST:event_btn_SAIRActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Inicio().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCadastroProduto;
    private javax.swing.JButton btnCadastroUsuario;
    private javax.swing.JButton btnCaixa;
    private javax.swing.JButton btn_SAIR;
    private javax.swing.JButton btn_consultaVendas;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JDesktopPane jDesktopPane2;
    private javax.swing.JDesktopPane jDesktopPane3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTabbedPane jTabbedPane1;
    // End of variables declaration//GEN-END:variables
}
